<script type="text/javascript" src="${request.contextPath}/backstage_res/ueditor/ueditor.all.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${request.contextPath}/backstage_res/ueditor/ueditor.config.js" charset="utf-8"></script>
<div>
	<form method="post" id="form_${action_id}" name="form_${action_id}" enctype="multipart/form-data" >	
	<input type="hidden" name="entity.id" value="${entity.id?default('')}" />
    <table class="form-table" cellpadding=3>
    	 <#if entity.channel.id!=3>
    	 	<tr>
	            <td>${action.getDatagridTitle('title')}:</td>
	            <td><input id="entity.title" name="entity.title" type="text" value="${entity.title?default('')}" style="width: 400px;"  class="easyui-validatebox" data-options="required:true,validType:'length[0,64]'"   /></td>
	        </tr>
	        <tr>
	            <td>${action.getDatagridTitle('param_3')}:</td>
	            <td><input id="entity.param_3" name="entity.param_3" type="text" value="${entity.param_3?default('')}" style="width: 400px;"  class="easyui-validatebox" data-options="required:true,validType:'length[0,64]'"   /></td>
	        </tr>
	        <tr>
	            <td>${action.getDatagridTitle('describe')}:</td>
	            <td><textarea id="entity.describe" name="entity.describe" style="height:150px;width:400px;resize: none;" type="text" class="easyui-validatebox" data-options="validType:'length[0,256]'"  >${entity.describe?default('')}</textarea></td>
	        </tr>
	        <tr>
	            <td>${action.getDatagridTitle('icon')}:</td>
		        <td>
					<input type="file"  name="entity.icon" id="entity_icon_${action_id}" onchange="$('#entity_icon_${action_id}_filename').empty();$('#entity_icon_${action_id}_filename').text(this.value);" style="display: none" />
					<a href="javascript:;;" id="entity_icon_${action_id}_btn" onclick="$('#entity_icon_${action_id}').click();" class="easyui-linkbutton" data-options="iconCls:'icon-add'">选择文件</a>	
		     		<span id="entity_icon_${action_id}_filename"></span>
		     		<a href="javascript:;;" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-tip'" id="entity_icon_${action_id}_preview" >${action.getText('bg.message.preview')}</a>
		     		<script type="text/javascript">
		     		$(function(){
		     			$('#entity_icon_${action_id}_preview').preview({html:'<div style="border:#c0c0c0 1px solid;background-color: white;"><img src="${iconUrl?default('')}${entity.icon?default('')}?_v=${timeMillis}" /></div>'});
		     		});
		     		</script>
		        </td>
	        </tr>
	        <#if entity.channel.id==2>
	        <tr>
	            <td>${action.getDatagridTitle('param')}:</td>
	            <td><input id="entity.param" name="entity.param" value="${entity.param?default('')}" type="text" style="width: 400px;"  class="easyui-validatebox" data-options="required:true,validType:'length[0,64]'"   /></td>
	        </tr>
	        <tr>
	            <td>${action.getDatagridTitle('param_2')}:</td>
	            <td><input id="entity.param_2" name="entity.param_2" value="${entity.param_2?default('')}" type="text" style="width: 400px;"  class="easyui-validatebox" data-options="required:true,validType:'length[0,64]'"   /></td>
	        </tr>
	        </#if>
    	 </#if>
    	 <#if entity.channel.id==3>
    	 <input type="hidden" name="entity.title" value="${entity.title?default('')}" />
    	 </#if>
        <#if entity.channel.id!=2>
        <tr>
           <td>${action.getDatagridTitle('content')}:</td>
            <td>
			<textarea id="ueditor_${action_id}" name="entity.content" style="height:400px;width:600px;resize: none;" >${entity.content?default('')}</textarea>
            </td>
        </tr>
        </#if>
    </table>
	</form>
</div>
<script type="text/javascript">
    //实例化编辑器
    var ue = UE.getEditor('ueditor_${action_id}',{
    	<#if toolbars??>
    	toolbars:[[${toolbars}]],
    	</#if>
    	imageUrl:"${request.contextPath}${namespace}/mp/article/article-upload.json",//图片上传提交地址
        imagePath:"${downloadUrl?default('')}",
        imageManagerUrl:"${request.contextPath}${namespace}/mp/article/article-imageManager.json",
        imageManagerPath:"${downloadUrl?default('')}"
        });
</script>